package cn.jiyun.service.impl;

import cn.jiyun.entity.XmDropdown;
import cn.jiyun.mapper.XmDropdownMapper;
import cn.jiyun.service.IXmDropdownService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-11-22
 */
@Service
public class XmDropdownServiceImpl extends ServiceImpl<XmDropdownMapper, XmDropdown> implements IXmDropdownService {

    @Override
    public Page findPage(Integer pageNum, Integer pageSize, XmDropdown xmDropdown) {
        Page<XmDropdown> xmDropdownPage = new Page<>(pageNum, pageSize);
        LambdaQueryWrapper<XmDropdown> qr = new LambdaQueryWrapper<>();
        qr.like(xmDropdown.getKeyy()!=null,XmDropdown::getKeyy,xmDropdown.getKeyy());
        qr.like(xmDropdown.getValuee()!=null,XmDropdown::getValuee,xmDropdown.getValuee());
        qr.like(xmDropdown.getBz()!=null,XmDropdown::getBz,xmDropdown.getBz());
        qr.eq(xmDropdown.getStatus()!=null,XmDropdown::getStatus,xmDropdown.getStatus());
        return baseMapper.selectPage(xmDropdownPage,qr);
    }
}
